package com.example.imgload_sdk.glide;

import android.widget.ImageView;

import com.example.imgload_sdk.R;


public class ImgLoad {

    public static void loadMatchImg(String url, ImageView imageView){
        GlideApp.with(imageView.getContext())
                .load(url)
                .placeholder(R.drawable.ic_launcher_background)
                .error(R.drawable.ic_launcher_background)
                .into(imageView);
    }

    public static void loadYuanImg(String url, ImageView imageView){
        GlideApp.with(imageView.getContext())
                .load(url)
                .placeholder(R.drawable.ic_launcher_background)
                .error(R.drawable.ic_launcher_background)
                .circleCrop()
                .into(imageView);
    }

    public static void loadThumbnail(String thumbnailUrl,String srcUrl, ImageView imageView){
        //添加缩略图请求，imageview先展示缩略图在展示原图
        //通过缩略图进行展示过度
        GlideApp.with(imageView.getContext())
                .load(srcUrl)
                .thumbnail(GlideApp.with(imageView.getContext())
                        .load(thumbnailUrl)).into(imageView);
    }
}
